package handler;

import codec.PacketCodeC;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import packet.AbstractPacket;

/**
 * @author Admin
 */
public class PacketEncoder extends MessageToByteEncoder<AbstractPacket> {

  @Override
  protected void encode(ChannelHandlerContext ctx, AbstractPacket packet, ByteBuf out) {
    PacketCodeC.INSTANCE.encode0(out, packet);
  }
}
